/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Operations.Wavelet;

import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.*;

/**
 *
 * @author littlechild
 */
public class WatermarkKey implements java.io.Serializable {
    public int level=3;
    public int T1=40;
    public int T2=50;
    public double alpha=0.2;
    double key[][]=null;
    public static void write(String filename, WatermarkKey key) throws IOException {
        ObjectOutputStream out = null;
        out = new ObjectOutputStream(new DeflaterOutputStream(new FileOutputStream(new File(filename))));
        out.writeObject(key);
        out.close();
    }
    public static WatermarkKey read(String filename) throws IOException{
        try {
            ObjectInputStream in = null;
            in = new ObjectInputStream(new InflaterInputStream(new FileInputStream(new File(filename))));
            return (WatermarkKey) in.readObject();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(WatermarkKey.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
}
